package emby.experimental;

import java.util.concurrent.Future;

import emby.lang.ThrownObject;
import emby.overload.OverloadRead;

public class EmbyReadableFuture<T> implements OverloadRead{
	private Future<T> f;
	
	public EmbyReadableFuture(Future<T> f){
		this.f = f;
	}

	@Override
	public Object operatorRead(int line) {
		try {
			return f.get();
		} catch (Exception e) {
			throw new ThrownObject(e);
		}
	}
}
